import 'package:animal/utils/screen_util.dart';
import 'package:flutter/material.dart';

/// 创建一个 Icon 展示控件
class NavigationIconWidget {
  /// 创建两个属性，一个是 用来展示 icon， 一个是动画处理
  final BottomNavigationBarItem item;

  /// 类似于 java 中的构造方法
  /// 创建 NavigationIconView 需要传入三个参数， icon 图标，title 标题， TickerProvider
  NavigationIconWidget({String? icon, String? activeIcon, String? title})
      : item = BottomNavigationBarItem(
    icon: Padding(
      padding: EdgeInsets.all(ScreenUtil().L(3)),
      child: Image.asset(
        "$icon",
        width: ScreenUtil().L(30),
      ),
    ),
    activeIcon: Padding(
      padding: EdgeInsets.all(ScreenUtil().L(3)),
      child: Image.asset(
        "$activeIcon",
        width: ScreenUtil().L(30),
      ),
    ),
    title: Text(
      "$title",
    ),
  );
}
